#include"ws_systolic.h"

int main(){
    data_t A[2*N][2*K];
    data_t B[2*M][2*N];
    data_t O[2*M][2*K];
    data_t GOLD_O[2*M][2*K];
    for(int i=0;i<2*N;i++)
    	for(int j=0;j<2*K;j++)
    		A[i][j]=i*2*K+j;
    for(int i=0;i<2*M;i++)
    	for(int j=0;j<2*N;j++)
    		B[i][j]=i*2*N+j+1;
    for(int i=0;i<2*M;i++)
    	for(int j=0;j<2*K;j++){
    		data_t tmp=0;
    		for(int k=0;k<2*N;k++)
    			tmp+=B[i][k]*A[k][j];
    		GOLD_O[i][j]=tmp;
    	}
    MUL((volatile data_t*)A,(volatile data_t*)B,(volatile data_t*)O,2*M,2*N,2*K);
    for(int i=0;i<2*M;i++){
    	for(int j=0;j<2*K;j++){
    		cout<<GOLD_O[i][j]<<","<<O[i][j]<<endl;
    		if(GOLD_O[i][j]!=O[i][j])
    			return -1;
    	}
    }
    return 0;
}
